

<?php
    function stripUnicode($str){
        if(!$str) return false;
        $unicode = array(
            'a'=>'á|à|ả|ã|ạ|ă|ắ|ặ|ằ|ẳ|ẵ|â|ấ|ầ|ẩ|ẫ|ậ',
            'd'=>'đ',
            'e'=>'é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ',
            'i'=>'í|ì|ỉ|ĩ|ị',
            'o'=>'ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ',
            'u'=>'ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự',
            'y'=>'ý|ỳ|ỷ|ỹ|ỵ',
        );
        foreach($unicode as $nonUnicode=>$uni) $str = preg_replace("/($uni)/i",$nonUnicode,$str);
return $str;
    }
?>
<?php
$lang = $this->lang->lang(); 
$data = $this->News_model->getBestNews($lang);

?>
<div class="floatRight sec_3"><!--

    	<div class="box">

        	<h1><?php echo lang('template.more')?></h1>

        </div> END BOX 

   -->
    
<style type="text/css">
		#content .sec_3 .news{background: #F2F2F2;padding: 5px;border-radius: 5px; position:relative;margin-right: 5px;}
		#content .sec_3 .news img{ position:absolute;margin: -20px 0 0 -20px;}
		#content .sec_3 .news ul{ margin-top:40px;}
		#content .sec_3 .news h1{background: #c52e27;padding: 5px;color: white;text-align: center; position:absolute; width:180px}
        #content .sec_3 .news ul li{ list-style:inside none; list-style-image:none; font-size:13px;margin-bottom:5px;}
		#content .sec_3 .news ul li em{ display:block; font-style:normal; padding:5px;}
		#content .sec_3 .news ul li a{ font-size:13px; font-family:"Arial", Geneva, sans-serif ;font-weight:bold;}
		#content .sec_3 .news ul li a:hover{color:#c52e27}
        #content .sec_3 .news ul li:hover{ list-style:inside none; list-style-image:none;}
        </style>
    	<div class="box news">

	
	<h1>HOT NEWS</h1>
            <img src="<?php echo base_url()?>/assets/images/icon/news.png" title="News" />
        	<ul>
        	   <?php foreach ($data as $ob){
        	$name = stripUnicode($ob['news_name']);
        	$name = str_replace(" ", "-", $name);
        	?>
        	
        	<li><em>Date: <?php echo $ob['createdDate']?></em><?php echo anchor('news/get/'.$name,$ob['news_name']);?><br/><p style="margin-left:100px;">Post by <?php echo $ob['author'];?></p></li>
        	 
      <?php }?>
            	            	
            </ul>
     
        </div><!-- END BOX -->

        

     

    </div><!-- END RIGHT -->
    
    
